object HigherOrderFunction {
  def main(args: Array[String]): Unit = {

    val decorator = new Decorator("[","]");
    println(apply(decorator.layout,7))

  }

  def apply(f:Int => String,v:Int) = f(v)

  class Decorator(left:String,right: String) {
    def layout(x:Int) = left+x.toString+right
  }

}
